package org.git.movie.controller;

import lombok.extern.slf4j.Slf4j;
import org.git.movie.annotations.Verify;
import org.git.movie.entity.RecommendSites;
import org.git.movie.form.VodRecommendForm;
import org.git.movie.service.IVodRecommendService;
import org.git.movie.service.RecommendSitesService;
import org.git.movie.util.BaseController;
import org.git.movie.util.BaseResponse;
import org.git.movie.vo.PageDto;
import org.git.movie.vo.RecommendSitesDto;
import org.git.movie.vo.VodRecommendDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author sqyc
 */
@Controller
@RequestMapping("recommendsites")
@Slf4j
public class RecommendSitesController extends BaseController {

    @Autowired
    private RecommendSitesService recommendSitesService;


    @ResponseBody
    @RequestMapping(value = "/findpage.do", method = {RequestMethod.POST,RequestMethod.GET})
    public BaseResponse<PageDto<RecommendSitesDto>> recommendsites_findpage(
            RecommendSites recommendSites,
            @Verify(param="pageNo",rule="required|min(1)") int pageNo,
            @Verify(param="pageSize",rule="required|min(3)|max(60)") int pageSize) {

        PageDto<RecommendSitesDto> page = recommendSitesService.findPage(recommendSites,pageNo,pageSize);
        return   ok(page);
    }
}
